home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / compiler / Miscsys.sig < prev    next >
Encoding:
Text File  |  1997-08-18  |  2.3 KB  |  57 lines  |  [TEXT/R*ch]

  1. (* Miscsys.sig -- not part of the new unified basis, 12-27-94 *)
  2.  
  3. (* This module provides a simple interface to the operating system. *)
  4.  
  5. (* exception SysErr of string * syserror option; *)
  6.         (* This exception is identical to sys__Sys_error in the runtime.
  7.            Raised by some functions, when the underlying system calls
  8.            fail. The argument to SysErr describes the error.
  9.            The texts of the error messages are implementation-dependent,
  10.            and should not be relied upon to catch specific system errors. *)
  11.  
  12. prim_val command_line : string Vector.vector = 0 "command_line";
  13.         (* The command line arguments given to the process.
  14.            The first element is the command name used to invoke the
  15.            program. *)
  16.  
  17. prim_val interactive: bool = 0 "interactive";
  18.         (* True if we're running under the toplevel system. False if
  19.            we're running as a standalone program. *)
  20.  
  21. prim_val getenv : string -> string = 1 "sys_getenv";
  22.         (* Return the value associated to a variable in the process
  23.            environment. Raise [Not_found] if the variable is unbound. *)
  24.  
  25. prim_val catch_interrupt : bool -> unit = 1 "sys_catch_break"
  26.   (* Currently, this doesn't work properly in the top-level system,
  27.      because it calls this primitive itself to prevent the system
  28.      from being interrupted while in critical intervals. *)
  29.         (* [catch_interrupt] governs whether user interrupt terminates
  30.            the program or raises the [Interrupt] exception. Call
  31.            [catch_interrupt true] to enable raising [Interrupt],
  32.            and [catch_interrupt false] to let the system terminate
  33.            the program on user interrupt. *)
  34.  
  35. prim_val system : string -> int = 1 "sml_system";
  36.         (* [system] executes a command of the underlying operating
  37.            system. If the argument is an empty string, this may
  38.            produce strange results under MS DOS. *)
  39.  
  40.  
  41. val remove : string -> unit
  42.  
  43. val rename : {old: string, new: string} -> unit
  44.  
  45. val chdir  : string -> unit
  46.  
  47.  
  48. (* [remove f] deletes the file [f] from the operating system.
  49.  
  50.    [rename{new, old}] renames file [old] to [new].
  51.  
  52.    [chdir dir] changes the current working directory of the process.
  53.    Note that there is no easy way of getting the current working
  54.    directory from the operating system.
  55. *)
  56.  
  57.